<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name . ' - About';
$this->breadcrumbs=array(
	'Báo cáo',
);
?>
<script>
function change(formid)
{
	if (formid==1)
	{
		document.getElementById("form1").hidden= false;
		document.getElementById("form2").hidden= true;
		document.getElementById("form3").hidden= true;
		document.getElementById("form4").hidden= true;
		document.getElementById("form5").hidden= true;
	}
	if (formid==2)
	{
		document.getElementById("form1").hidden= true;
		document.getElementById("form2").hidden= false;
		document.getElementById("form3").hidden= true;
		document.getElementById("form4").hidden= true;
		document.getElementById("form5").hidden= true;
	}
	if (formid==3)
	{
		document.getElementById("form1").hidden= true;
		document.getElementById("form2").hidden= true;
		document.getElementById("form3").hidden= false;
		document.getElementById("form4").hidden= true;
		document.getElementById("form5").hidden= true;
	}
	if (formid==4)
	{
		document.getElementById("form1").hidden= true;
		document.getElementById("form2").hidden= true;
		document.getElementById("form3").hidden= true;
		document.getElementById("form4").hidden= false;
		document.getElementById("form5").hidden= true;
	}
	if (formid==5)
	{
		document.getElementById("form1").hidden= true;
		document.getElementById("form2").hidden= true;
		document.getElementById("form3").hidden= true;
		document.getElementById("form4").hidden= true;
		document.getElementById("form5").hidden= false;
	}
}

function check(id)
{
	if (document.getElementById("khoaphutrach"+id).value==0)
	{
		alert('Hãy chọn khoa phụ trách!');
		return false;
	}
	return true;
}
</script>
<h1>Xuất báo cáo</h1>

<!-- <a href="index.php?r=site/page&view=report&bc=pcgvch">Báo cáo phân công giảng viên cơ hữu</a> --->
<a href="#" onclick="change(1)">Báo cáo phân công giảng viên cơ hữu</a>
<form id="form1" name="form1" method="post" action="index.php?r=site/page&view=PCGiangvienCH" target="_blank" hidden="hidden">
	Chọn khoa phụ trách: <select name="khoaphutrach1" id="khoaphutrach1">
	<option value="0">Chọn khoa phụ trách</option>
	<?php
		$connection=Yii::app()->db;
		$command=$connection->createCommand("SELECT * FROM `donvicongtac`")->query();
		//echo '<option value="'.count($command).'">'.count($command).'</option>';
		foreach ($command as $row)
		{
			echo '<option value="'.$row['madonvi'].'">'.$row['tendonvi'].'</option>';
		}
	?>
	</select>
	<input type="submit" name="submit" id="submit" onclick="return check(1);" value="Xuất báo cáo" />
</form>


</br><a href="#" onclick="change(3)">Kế hoạch thỉnh giảng</a>
<form id="form3" name="form3" method="post" action="index.php?r=site/page&view=Thinhgiang" target="_blank" hidden="hidden">
	Chọn khoa phụ trách: <select name="khoaphutrach3" id="khoaphutrach3">
	<option value="0">Chọn khoa phụ trách</option>
	<?php
		$connection=Yii::app()->db;
		$command=$connection->createCommand("SELECT * FROM `donvicongtac`")->query();
		//echo '<option value="'.count($command).'">'.count($command).'</option>';
		foreach ($command as $row)
		{
			echo '<option value="'.$row['madonvi'].'">'.$row['tendonvi'].'</option>';
		}
	?>
	</select>
	<input type="submit" name="submit" id="submit" onclick="return check(3);" value="Xuất báo cáo" />
</form>


</br><a href="#" onclick="change(5)">Kế hoạch mở nhóm</a>
<form id="form5" name="form5" method="post" action="index.php?r=site/page&view=KHMoNhom" target="_blank" hidden="hidden">
	Chọn khoa phụ trách: <select name="khoaphutrach5" id="khoaphutrach5">
	<option value="0">Chọn khoa phụ trách</option>
	<?php
		$connection=Yii::app()->db;
		$command=$connection->createCommand("SELECT * FROM `donvicongtac`")->query();
		//echo '<option value="'.count($command).'">'.count($command).'</option>';
		foreach ($command as $row)
		{
			echo '<option value="'.$row['madonvi'].'">'.$row['tendonvi'].'</option>';
		}
	?>
	</select></br>
	Chọn học kỳ: <select name="hocky" id="hocky">
		<option value="1">1</option>
		<option value="2">2</option>
		<option value="3">3</option>
		</select></br>
	<input type="submit" name="submit" id="submit" onclick="return check(5);" value="Xuất báo cáo" />
</form>


</br><a href="#" onclick="change(2)">Báo cáo Danh sách các nhóm lớp bị hủy</a>
<form id="form2" name="form2" method="post" action="index.php?r=site/page&view=DSlopbihuy" target="_blank" hidden="hidden">
	Chọn khoa phụ trách: <select name="khoaphutrach2" id="khoaphutrach2">
	<option value="0">Chọn khoa phụ trách</option>
	<?php
		$connection=Yii::app()->db;
		$command=$connection->createCommand("SELECT * FROM `donvicongtac`")->query();
		foreach ($command as $row)
		{
			echo '<option value="'.$row['madonvi'].'">'.$row['tendonvi'].'</option>';
		}
	?>
	</select>
	<input type="submit" name="submit" id="submit" onclick="return check(2);" value="Xuất báo cáo" />
</form>


<!---
</br><a href="#" onclick="change(4)">Tính tiết giảng viên cơ hữu</a></br>--->
<form id="form4" name="form4" method="post" action="index.php?r=site/page&view=PCGiangvienCH" target="_blank" hidden="hidden">
	Chọn khoa phụ trách: <select name="khoaphutrach" id="khoaphutrach">
	<?php
		$connection=Yii::app()->db;
		$command=$connection->createCommand("SELECT * FROM `donvicongtac`")->query();
		//echo '<option value="'.count($command).'">'.count($command).'</option>';
		foreach ($command as $row)
		{
			echo '<option value="'.$row['madonvi'].'">'.$row['tendonvi'].'</option>';
		}
	?>
	</select>
	<input type="submit" name="submit" id="submit" value="Xuất báo cáo" />
</form>